const tasksDao = require('../models/dao/taskDao');

module.exports = {
	AddTask: async (ctx) => {
		let { task } = ctx.request.body;
		let result = await tasksDao.AddTask(task);
		ctx.body = {
			code: '200',
			msg: '成功',
			data: result,
		};

		return;
	},
	GetAddedTasks: async (ctx) => {
		let result = await tasksDao.GetAddedTasks();
		ctx.body = {
			code: '200',
			msg: '成功',
			data: result,
		};

		return;
	},
	GetFinishedTasks: async (ctx) => {
		let result = await tasksDao.GetFinisedTasks();
		ctx.body = {
			code: '200',
			msg: '成功',
			data: result,
		};

		return;
	},
};
